package com.abuaziz.librarys.ShapeViews

import android.graphics.Color
import android.os.Bundle
import android.provider.CalendarContract
import com.abuaziz.librarys.BaseActivity
import com.abuaziz.librarys.R
import com.ug_project.views.click
import com.ug_project.views.content
import kotlinx.android.synthetic.main.activity_custom_shape_view.*
import me.ezitku.base.ShapeViews.Background
import me.ezitku.base.ShapeViews.selector
import me.ezitku.base.extensions.*
import me.ezitku.base.extensions.BroadCastReceiver.receiverScreenOnOff
import me.ezitku.base.extensions.Notification.createNotification
import me.ezitku.base.extensions.permission.requestPermiss

class CustomShapeView : BaseActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_custom_shape_view)


        demo_button.Background {
            focus {
                strokeWidth = 3
                strokeColor = Color.parseColor("#000000")
            }
            normal {
                strokeWidth = 1
                strokeColor = Color.parseColor("#fff000")
            }
        }

        test_text.click {
            test_text.isSelected = !test_text.isSelected
        }

//        test_text.Background {
//            selected {
//                left_bottom_radius = 10f
//                right_bottom_radius=10f
//                strokeColor = Color.RED
//                strokeWidth = 3
//                dashWidth = 3f
//                dashGap = 3f
//                color = Color.RED
//            }
//            normal {
//                strokeColor = Color.RED
//                strokeWidth = 3
//                dashWidth = 3f
//                dashGap = 3f
//            }
//        }


        format.click {
            val price = price.content
            val decimal = decimal.content.toInt()
            format_result.content = "${price.toDouble().format(decimal)}"

        }
    }
}